package com.hopes.bizz.risk.integral.vo;

import com.hopes.bizz.common.core.util.DateUtils;
import com.hopes.bizz.risk.common.constant.enums.RiskIntegralDicEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * @author daijie
 * @version 1.0
 * @date 2023/7/24 10:17
 * @Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "个人积分记录VO")
public class RiskIntegralRecordVO extends BaseLogicEntity {

    private static final long serialVersionUID = 6824200782505949432L;

    @Schema(description="标识")
    private Long id;

    @Schema(description="业务标识")
    private Long bizId;

    @Schema(description="账户")
    private Long accountId;

    @Schema(description="事件名称")
    private Integer eventName;

    @Schema(description="积分值")
    private Integer integral;

    @Schema(description="记录时间")
    private Date eventTime;

    @Schema(description="统计时间")
    private Date statisticalDate;

    @Schema(description="机构ID")
    private Long orgId;

    public String getEventTimeStr() {
        return DateUtils.limitSecond(this.eventTime);
    }

    public String getStatisticalDateStr() {
        return DateUtils.limitDay(this.statisticalDate);
    }

    public String getEventNameStr() {
        return DictResolver.getItemLabelByValue(RiskIntegralDicEnum.risk_integral_event, this.getEventName());
    }

    public String getAccountIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_user, this.getAccountId());
    }
}
